Introduction

Human interactions and human behaviors has been a fascinating and challenging subject of study in recent times. Social network companies, consumer markets, medical industries have been trying to study human behavior to predict the consumer needs, recommend goods, optimize marketing strategies, or in case of medical industry diagnose and study disease patterns. Child psychology and child interaction behavior is very different from an adult behavior. Study of children interaction pattern is very important to understand and improve the development of children. These studies have been used to understand the development in children as well as spreading of highly communicable disease like influenza, hepatitis and measles. Children are prone to these diseases and the pattern study of interaction of children helps to find the propagation and evaluation of the control measures of these diseases. Through this study, we want to find how age, gender, grade affect the interaction pattern in children.

Data

Data for this project was obtained from the Socio patterns website (sociopatterns.org). The dataset had two networks, one for each day, of face-to-face interaction between students and teachers. These interactions were collected from a French school in 2009 using radio frequency identification devices that recognizes an interaction by proximity sensors. The students involved in the data are ages 6 to 12 attending grades 1 to 5. There were 232 children and 10 teachers who were involved in 77,602 contacts amongst each other in course of two days. There were 10 classes, grades 1 to 5 with section A and B, and in each grade, there were around 25 students. In average, each child had around 165 interactions and spent an average of 176 minutes in interaction per day. The gender and grade were provided for the children and also the count and duration of interactions were provided. For a contact to occur between two individuals, they must be in certain proximity for at least 20 seconds. A packet of information is sent after every 20 second. A contact is broken once they are further than the defined proximity and if they come in contact again new contact is added and time is added to previous duration.

Analysis

Analysis for this project was focused on finding patterns of interaction by grades and gender to study if the students show homophile behavior. Do children of opposite sex interact as much as same sex? Which grades/age children are more social? How popular are the most popular student? In following analysis we will be trying to answer these quesitons.

Data Exploration

The files from the data source website were in GEXF gephi format, one file for each day. I loaded the files in gephi and explored different layouts to visualize the network data.

Degree Distribution for Day 1


Degree Distribution for Day 2


Using the gephi community detection, there were 8 communities detected for both days with modularity of 0.75. The algorithm performs well on separating communities by grades. Same grade students form a community. This measure shows how well the network can decomposed into modular communities. Grades 2A and 2B are in same community, grade 5A and grade 5B are in same communities while Grades 1A and 1B, 3A and 3B, and 4A and 4B form separate communities. This also shows sign of homophile behavior since there is high interaction between same grade students which resulted in same grade students being in same community.

Communities detected by Gephi Modularity Algorithm



Degree Distribution by Grade

Degree Distribution by Gender



Over the course of two days, grade 1B had the most interactions. Comparing to the other section, the same grade (1A) students had half the number of contacts. Teachers seem to have the least contacts and among the classes grade 4B had the lowest number of contacts.

Heatmap of interactions by Grade



The average weighted degree was 10 and maximum was 23. This means in average a student interacted with 10 individual and the student who had the most interactions connected with 23 other students in the given day.

In the histogram, we see the distribution of weighted degree by gender. For both male and female students, the histogram looks normally distributed with most students towards the middle of the chart. We can say, the chart is a bit skewed to the right since there are few students with high degree.

When comparing boys versus girls, looks like boys are more interactive. Girls have degree 10 as the highest count which means degree 10 is the most common amongst the girls. Whereas for boys degree 14 is the most common degree. Also the person with highest degree(23) is a boy.

Weighted degree by Grade


In the above graph, the nodes are sized by weighted degree and the label size by node size. The color of the nodes are partitioned by the grades. There are grades 1 to 5 with 2 sections for each grade. Teacher nodes are colored red.

In this network, students in same grade are grouped together because they are more likely to form their own committee with most interaction happening with students in same grade. Grade 1B clearly pop out with most students in the class with higher weighted degree. Grade 1B students are highly interactive with larger nodes. Furthermore,grades 2B, 4A and 3B have one student each with relatively big nodes. These individual students are likely to be the most social student in those classes. In contrast, grades 4B and 2A don’t seem to have high degree nodes. Few dark edges are visible explaning they might have had interaction between fewer students but those interactions were significant ( longer or multiple interaction between same students).

Interestingly, teacher do not show high weighted degree. One teacher in the middle of 1B student nodes look to be more interactive than others.

Centrality Measure correlations


There is a strong correlation between degree and pagerank. This means important nodes are high degree nodes. Another interesting insight is betweenness centrality and degree centrality are not strongly correlated. This means high degree nodes are not the connections for most interactions. This proves that the most interactive student may not be the fastest connection between two students.

In addition, there seem to be no correlation between eigenvector and betweenness centrality. With means most influencing students in this network are not the in-between connections for most interaction. There are many students and many interactions happening so even the most influencing students would not necessarily be the connections for other students interactions.

Eigenvector Centrality


To look at the most influencing node we check the eigenvector centrality measure. High degree nodes do not necessarily the most important nodes. It uses adjacency matrix of the graph to calculate the eigenvalues.

The nodes and label size is sized by the eigenvector centrality measure. We again see nodes from grade 1B with high eigenvector centrality. They are the most influencing nodes in the network.

Highest Weighted Degree nodes


The graph above shows the top three highest degree nodes. These are nodes 1697, 1890 and 1688. They are from Grades 1B and 2B. They have weighted degree of 23 and 22. The color of the nodes are based on the male and female gender and the red node is the highest degree node.

The students from smaller grades have higher degree interaction and are more influencing. As the kids get older they seem to have smaller friend circle and less interactions between them.

Network properties

## [1] TRUE
## [1] TRUE
## [1] TRUE
## [1] TRUE
## [1] 10
## [1] 9

Degree Boxplot by Grade

### Giant Components

## [1] 234
## IGRAPH UN-- 234 1148 -- 
## + attr: name (v/c), Label (v/n), timeset (v/l), X0 (v/c), X1
## | (v/c), Age (v/n), Grade (v/c), Type (e/c), Id (e/n), Label
## | (e/l), timeset (e/l), Weight (e/n), X2 (e/n), X3 (e/n),
## | Calc.Weight (e/n)
## [1] 235
## IGRAPH UN-- 235 1328 -- 
## + attr: name (v/c), Label (v/n), timeset (v/l), X0 (v/c), X1
## | (v/c), Age (v/n), Grade (v/c), Type (e/c), Id (e/n), Label
## | (e/l), timeset (e/l), Weight (e/n), X2 (e/n), X3 (e/n),
## | Calc.Weight (e/n)

Centrality Measures Corr Plot

### Betweeness and Closeness Distributon ### ERGM Models

Model 1 for Day 1

simple model no mcmc stored

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_1.net ~ edges + nodemix("X1", base = c(-1, -2, -3))
## 
## Iterations:  6 out of 20 
## 
## Monte Carlo MLE Results:
##            Estimate Std. Error MCMC % p-value    
## edges      -3.29971    0.09937      0 < 1e-04 ***
## mix.X1.F.F  0.30291    0.11672      0 0.00946 ** 
## mix.X1.F.M -0.08278    0.11159      0 0.45822    
## mix.X1.M.M  0.51647    0.11317      0 < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 37792  on 27261  degrees of freedom
##  Residual Deviance:  9448  on 27257  degrees of freedom
##  
## AIC: 9456    BIC: 9489    (Smaller is better.)

### Model 2 added Age difference and MCMC burnin

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_1.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + absdiff("Age")
## 
## Iterations:  7 out of 20 
## 
## Monte Carlo MLE Results:
##             Estimate Std. Error MCMC % p-value    
## edges       -0.85584    0.11355      0  <1e-04 ***
## mix.X1.F.F  -0.98609    0.12690      0  <1e-04 ***
## mix.X1.F.M  -1.38049    0.12180      0  <1e-04 ***
## mix.X1.M.M  -0.74723    0.12358      0  <1e-04 ***
## absdiff.Age -1.13837    0.04038      0  <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 37792  on 27261  degrees of freedom
##  Residual Deviance:  8048  on 27256  degrees of freedom
##  
## AIC: 8058    BIC: 8099    (Smaller is better.)

Model 3

added Degree 1

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_1.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + degree(2:4) + 
##     degree(8:9) + absdiff("Age")
## 
## Iterations:  4 out of 20 
## 
## Monte Carlo MLE Results:
##             Estimate Std. Error MCMC % p-value    
## edges       -0.79269    0.12165      0 < 1e-04 ***
## mix.X1.F.F  -0.92745    0.12788      0 < 1e-04 ***
## mix.X1.F.M  -1.35689    0.12719      0 < 1e-04 ***
## mix.X1.M.M  -0.75709    0.12808      0 < 1e-04 ***
## degree2      2.11227    0.43478      0 < 1e-04 ***
## degree3      1.59528    0.35976      0 < 1e-04 ***
## degree4      1.27480    0.30049      0 < 1e-04 ***
## degree8     -0.86100    0.33498      0 0.01017 *  
## degree9     -0.88450    0.31153      0 0.00453 ** 
## absdiff.Age -1.14815    0.04086      0 < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 37792  on 27261  degrees of freedom
##  Residual Deviance:  7984  on 27251  degrees of freedom
##  
## AIC: 8004    BIC: 8086    (Smaller is better.)

### Model 4 updated degree(2:4) based on GOF from Model 3 and added gwesp

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_1.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + degree(2:4) + 
##     degree(8:9) + absdiff("Age") + gwesp(cutoff = 7)
## 
## Iterations:  20 out of 20 
## 
## Monte Carlo MLE Results:
##             Estimate Std. Error MCMC % p-value    
## edges       -2.57449    0.14157      1  <1e-04 ***
## mix.X1.F.F  -0.61957    0.09787      2  <1e-04 ***
## mix.X1.F.M  -1.03755    0.10462      2  <1e-04 ***
## mix.X1.M.M  -0.56446    0.09720      2  <1e-04 ***
## degree2      0.68043    0.40375      0  0.0919 .  
## degree3      0.78350    0.43555      0  0.0721 .  
## degree4      0.48634    0.45145      0  0.2814    
## degree8     -0.74868    0.62571      0  0.2315    
## degree9     -0.81530    0.55616      0  0.1427    
## absdiff.Age -0.72378    0.02590      1  <1e-04 ***
## gwesp        0.51594    0.02432      0  <1e-04 ***
## gwesp.decay  1.31566    0.03398      1  <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 37792  on 27261  degrees of freedom
##  Residual Deviance:  7579  on 27249  degrees of freedom
##  
## AIC: 7603    BIC: 7702    (Smaller is better.)
## Sample statistics summary:
## 
## Iterations = 50000:5165000
## Thinning interval = 5000 
## Number of chains = 1 
## Sample size per chain = 1024 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                  Mean      SD Naive SE Time-series SE
## edges        1993.991  85.432  2.66975       16.54264
## mix.X1.F.F    522.465  33.063  1.03323        4.61356
## mix.X1.F.M    709.263  42.547  1.32959        6.85926
## mix.X1.M.M    603.961  37.210  1.16280        4.44671
## degree2         4.781   2.187  0.06836        0.14928
## degree3         5.129   2.587  0.08083        0.28338
## degree4         4.176   2.386  0.07458        0.32020
## degree8         2.431   1.569  0.04904        0.07042
## degree9         2.754   1.655  0.05172        0.05783
## absdiff.Age  1240.912  76.248  2.38274        6.86244
## gwesp        4463.521 268.355  8.38610       49.36679
## gwesp.decay -2884.815 130.673  4.08354       24.39587
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%   50%   75%   97.5%
## edges        1813.6  1942.8  2002  2053  2140.0
## mix.X1.F.F    458.0   499.0   524   546   584.4
## mix.X1.F.M    625.6   680.8   709   740   787.4
## mix.X1.M.M    532.0   580.0   604   631   671.4
## degree2         1.0     3.0     5     6     9.0
## degree3         1.0     3.0     5     7    11.0
## degree4         0.0     2.0     4     6     9.0
## degree8         0.0     1.0     2     3     6.0
## degree9         0.0     2.0     3     4     6.0
## absdiff.Age  1079.2  1190.0  1241  1294  1386.7
## gwesp        3879.0  4300.5  4487  4657  4921.0
## gwesp.decay -3101.4 -2979.3 -2901 -2804 -2610.1
## 
## 
## Sample statistics cross-correlations:
##                  edges  mix.X1.F.F mix.X1.F.M  mix.X1.M.M     degree2
## edges        1.0000000  0.64854114  0.8473006  0.66909334 -0.34776211
## mix.X1.F.F   0.6485411  1.00000000  0.4125069  0.09486298 -0.24939066
## mix.X1.F.M   0.8473006  0.41250687  1.0000000  0.38999358 -0.30414068
## mix.X1.M.M   0.6690933  0.09486298  0.3899936  1.00000000 -0.21657916
## degree2     -0.3477621 -0.24939066 -0.3041407 -0.21657916  1.00000000
## degree3     -0.4791986 -0.33282169 -0.3939830 -0.30668792  0.11019782
## degree4     -0.5030838 -0.35440506 -0.4080000 -0.31108568  0.16934546
## degree8     -0.2700660 -0.16662641 -0.2320741 -0.18428319  0.06477757
## degree9     -0.1697598 -0.10636084 -0.1633089 -0.11039807  0.04748921
## absdiff.Age  0.8194284  0.49995212  0.6811516  0.58627193 -0.25891210
## gwesp        0.9827517  0.64829234  0.8339447  0.65144855 -0.31941027
## gwesp.decay -0.9627086 -0.61906952 -0.8130220 -0.64600436  0.37562961
##                 degree3     degree4     degree8     degree9 absdiff.Age
## edges       -0.47919863 -0.50308376 -0.27006600 -0.16975981   0.8194284
## mix.X1.F.F  -0.33282169 -0.35440506 -0.16662641 -0.10636084   0.4999521
## mix.X1.F.M  -0.39398301 -0.40800002 -0.23207413 -0.16330886   0.6811516
## mix.X1.M.M  -0.30668792 -0.31108568 -0.18428319 -0.11039807   0.5862719
## degree2      0.11019782  0.16934546  0.06477757  0.04748921  -0.2589121
## degree3      1.00000000  0.22482332  0.07107867  0.02340122  -0.3496623
## degree4      0.22482332  1.00000000  0.07399524  0.05081019  -0.3556496
## degree8      0.07107867  0.07399524  1.00000000  0.05703447  -0.1979823
## degree9      0.02340122  0.05081019  0.05703447  1.00000000  -0.1183437
## absdiff.Age -0.34966228 -0.35564960 -0.19798227 -0.11834366   1.0000000
## gwesp       -0.44102066 -0.47915968 -0.28239490 -0.17741969   0.7699191
## gwesp.decay  0.49707056  0.51928048  0.26575648  0.16758550  -0.7969449
##                  gwesp gwesp.decay
## edges        0.9827517  -0.9627086
## mix.X1.F.F   0.6482923  -0.6190695
## mix.X1.F.M   0.8339447  -0.8130220
## mix.X1.M.M   0.6514485  -0.6460044
## degree2     -0.3194103   0.3756296
## degree3     -0.4410207   0.4970706
## degree4     -0.4791597   0.5192805
## degree8     -0.2823949   0.2657565
## degree9     -0.1774197   0.1675855
## absdiff.Age  0.7699191  -0.7969449
## gwesp        1.0000000  -0.9279204
## gwesp.decay -0.9279204   1.0000000
## 
## Sample statistics auto-correlation:
## Chain 1 
##               edges mix.X1.F.F mix.X1.F.M mix.X1.M.M   degree2   degree3
## Lag 0     1.0000000  1.0000000  1.0000000  1.0000000 1.0000000 1.0000000
## Lag 5000  0.9008796  0.8422287  0.8239322  0.8410396 0.3033610 0.3913391
## Lag 10000 0.8208001  0.7345352  0.7122471  0.7410395 0.2166939 0.3048311
## Lag 15000 0.7541697  0.6563672  0.6269672  0.6585687 0.2042927 0.3007758
## Lag 20000 0.6883340  0.5968886  0.5518889  0.5831834 0.1772719 0.2663521
## Lag 25000 0.6426112  0.5315558  0.4944206  0.5321341 0.1223783 0.2651056
##             degree4    degree8      degree9 absdiff.Age     gwesp
## Lag 0     1.0000000 1.00000000  1.000000000   1.0000000 1.0000000
## Lag 5000  0.3854949 0.07004986  0.050475523   0.7657024 0.8839421
## Lag 10000 0.3547671 0.13405949  0.062588166   0.6057205 0.7897196
## Lag 15000 0.3339432 0.04682326 -0.020676629   0.4896142 0.7199504
## Lag 20000 0.3025383 0.06597519  0.030875139   0.3967045 0.6551354
## Lag 25000 0.3236647 0.09748826 -0.003226675   0.3314613 0.6111442
##           gwesp.decay
## Lag 0       1.0000000
## Lag 5000    0.9043520
## Lag 10000   0.8361846
## Lag 15000   0.7747848
## Lag 20000   0.7190098
## Lag 25000   0.6771558
## 
## Sample statistics burn-in diagnostic (Geweke):
## Chain 1 
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
##       edges  mix.X1.F.F  mix.X1.F.M  mix.X1.M.M     degree2     degree3 
##      0.3971      0.6746     -0.4449      0.7307     -1.4091     -1.0110 
##     degree4     degree8     degree9 absdiff.Age       gwesp gwesp.decay 
##     -1.0313     -1.0327     -0.3278      0.4542      0.4160     -0.4288 
## 
## Individual P-values (lower = worse):
##       edges  mix.X1.F.F  mix.X1.F.M  mix.X1.M.M     degree2     degree3 
##   0.6913113   0.4999042   0.6563927   0.4649537   0.1587952   0.3120213 
##     degree4     degree8     degree9 absdiff.Age       gwesp gwesp.decay 
##   0.3024063   0.3017263   0.7430849   0.6496927   0.6774031   0.6680948 
## Joint P-value (lower = worse):  0 .

## 
## MCMC diagnostics shown here are from the last round of simulation, prior to computation of final parameter estimates. Because the final estimates are refinements of those used for this simulation run, these diagnostics may understate model performance. To directly assess the performance of the final model on in-model statistics, please use the GOF command: gof(ergmFitObject, GOF=~model).

### Model 6 added Degree 9, nodematch for Grade and increased burnin computation This is much better model. MCMC statistics show some autocorrelation but the joint pvalue is better.

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_1.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + nodematch("X0") + 
##     degree(2:4) + degree(9)
## 
## Iterations:  4 out of 20 
## 
## Monte Carlo MLE Results:
##              Estimate Std. Error MCMC % p-value    
## edges        -3.68843    0.08760      0 < 1e-04 ***
## mix.X1.F.F   -0.42904    0.09784      0 < 1e-04 ***
## mix.X1.F.M   -1.04572    0.09695      0 < 1e-04 ***
## mix.X1.M.M   -0.26522    0.09314      0 0.00441 ** 
## nodematch.X0  3.94314    0.07686      0 < 1e-04 ***
## degree2       4.14135    0.33006      0 < 1e-04 ***
## degree3       2.95658    0.33088      0 < 1e-04 ***
## degree4       2.23026    0.29091      0 < 1e-04 ***
## degree9      -0.84032    0.31849      0 0.00833 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 37792  on 27261  degrees of freedom
##  Residual Deviance:  6099  on 27252  degrees of freedom
##  
## AIC: 6117    BIC: 6191    (Smaller is better.)
## Sample statistics summary:
## 
## Iterations = 1e+05:20575000
## Thinning interval = 5000 
## Number of chains = 1 
## Sample size per chain = 4096 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                   Mean     SD Naive SE Time-series SE
## edges        -13.66382 91.473  1.42927       13.80263
## mix.X1.F.F    -5.46997 30.855  0.48210        3.66628
## mix.X1.F.M    -6.93506 37.769  0.59014        4.99763
## mix.X1.M.M    -2.09766 27.852  0.43518        2.54928
## nodematch.X0  -8.74414 63.205  0.98758        9.28293
## degree2        0.75586  5.859  0.09154        0.84932
## degree3        0.91235  5.705  0.08914        0.81774
## degree4        1.16602  6.407  0.10012        0.81451
## degree9       -0.07227  3.259  0.05092        0.06986
## 
## 2. Quantiles for each variable:
## 
##                2.5%    25% 50%   75% 97.5%
## edges        -234.6 -66.25   2 50.00 129.6
## mix.X1.F.F    -72.0 -25.00  -3 17.00  49.0
## mix.X1.F.M    -93.0 -29.00  -2 20.00  55.0
## mix.X1.M.M    -66.0 -20.00   0 17.00  46.0
## nodematch.X0 -162.0 -45.00   1 36.25  90.0
## degree2        -7.0  -3.00   0  4.00  15.0
## degree3        -8.0  -3.00   0  4.00  15.0
## degree4        -9.0  -3.25   0  5.00  16.0
## degree9        -6.0  -2.00   0  2.00   7.0
## 
## 
## Sample statistics cross-correlations:
##                    edges  mix.X1.F.F  mix.X1.F.M  mix.X1.M.M nodematch.X0
## edges         1.00000000  0.85775713  0.92400390  0.77151715   0.97567718
## mix.X1.F.F    0.85775713  1.00000000  0.75043524  0.47152503   0.84151366
## mix.X1.F.M    0.92400390  0.75043524  1.00000000  0.62203424   0.91914532
## mix.X1.M.M    0.77151715  0.47152503  0.62203424  1.00000000   0.75578202
## nodematch.X0  0.97567718  0.84151366  0.91914532  0.75578202   1.00000000
## degree2      -0.83441832 -0.73487368 -0.77051072 -0.60486427  -0.81447905
## degree3      -0.82723780 -0.72330528 -0.76458964 -0.61704506  -0.80854331
## degree4      -0.81875942 -0.71433137 -0.75141628 -0.62239090  -0.79804457
## degree9       0.05053908  0.07348491  0.05065768 -0.00826246   0.04504015
##                 degree2     degree3    degree4     degree9
## edges        -0.8344183 -0.82723780 -0.8187594  0.05053908
## mix.X1.F.F   -0.7348737 -0.72330528 -0.7143314  0.07348491
## mix.X1.F.M   -0.7705107 -0.76458964 -0.7514163  0.05065768
## mix.X1.M.M   -0.6048643 -0.61704506 -0.6223909 -0.00826246
## nodematch.X0 -0.8144790 -0.80854331 -0.7980446  0.04504015
## degree2       1.0000000  0.65407198  0.6260663 -0.13268049
## degree3       0.6540720  1.00000000  0.6033828 -0.09768586
## degree4       0.6260663  0.60338279  1.0000000 -0.09415660
## degree9      -0.1326805 -0.09768586 -0.0941566  1.00000000
## 
## Sample statistics auto-correlation:
## Chain 1 
##               edges mix.X1.F.F mix.X1.F.M mix.X1.M.M nodematch.X0
## Lag 0     1.0000000  1.0000000  1.0000000  1.0000000    1.0000000
## Lag 5000  0.9511848  0.9052019  0.8999225  0.8554150    0.9687199
## Lag 10000 0.9250263  0.8631506  0.8516169  0.7932068    0.9416796
## Lag 15000 0.9049214  0.8312281  0.8170676  0.7516522    0.9180119
## Lag 20000 0.8860790  0.8069029  0.7869850  0.7144684    0.8957487
## Lag 25000 0.8699562  0.7834487  0.7614632  0.6752455    0.8737800
##             degree2   degree3   degree4    degree9
## Lag 0     1.0000000 1.0000000 1.0000000 1.00000000
## Lag 5000  0.7785616 0.7214853 0.7117399 0.05549559
## Lag 10000 0.7399260 0.7013840 0.6892196 0.07378195
## Lag 15000 0.7213618 0.6884767 0.6714934 0.04825174
## Lag 20000 0.7047914 0.6708178 0.6535243 0.02863306
## Lag 25000 0.6991061 0.6530943 0.6388633 0.03976281
## 
## Sample statistics burn-in diagnostic (Geweke):
## Chain 1 
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
##        edges   mix.X1.F.F   mix.X1.F.M   mix.X1.M.M nodematch.X0 
##       0.5443       0.4658       0.6542       0.9741       0.5935 
##      degree2      degree3      degree4      degree9 
##      -0.6367      -0.4703      -0.5762       0.6156 
## 
## Individual P-values (lower = worse):
##        edges   mix.X1.F.F   mix.X1.F.M   mix.X1.M.M nodematch.X0 
##    0.5862662    0.6413416    0.5129901    0.3300264    0.5528261 
##      degree2      degree3      degree4      degree9 
##    0.5243065    0.6381238    0.5644464    0.5381821 
## Joint P-value (lower = worse):  0.9940786 .

## 
## MCMC diagnostics shown here are from the last round of simulation, prior to computation of final parameter estimates. Because the final estimates are refinements of those used for this simulation run, these diagnostics may understate model performance. To directly assess the performance of the final model on in-model statistics, please use the GOF command: gof(ergmFitObject, GOF=~model).

Model 1 for Day 2

Simple model to begin with

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodemix("X1") + nodematch("X0")
## 
## Iterations:  7 out of 20 
## 
## Monte Carlo MLE Results:
##                        Estimate Std. Error MCMC %  p-value    
## edges                  -6.56876    0.60448      0  < 1e-04 ***
## mix.X1.F.F              2.21000    0.60464      0 0.000258 ***
## mix.X1.F.M              1.81354    0.60285      0 0.002630 ** 
## mix.X1.M.M              2.56825    0.60450      0  < 1e-04 ***
## mix.X1.F.Unknown        2.61712    0.62282      0  < 1e-04 ***
## mix.X1.M.Unknown        2.62221    0.62233      0  < 1e-04 ***
## mix.X1.Unknown.Unknown       NA    0.00000      0       NA    
## nodematch.X0            4.08483    0.07257      0  < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance:  6654  on 27487  degrees of freedom
##  
## AIC: 6670    BIC: 6736    (Smaller is better.)

Model 2 and 3

added age difference and nodemix for gender

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + absdiff("Age")
## 
## Iterations:  7 out of 20 
## 
## Monte Carlo MLE Results:
##             Estimate Std. Error MCMC % p-value    
## edges       -1.12167    0.10696      0  <1e-04 ***
## mix.X1.F.F  -0.71536    0.11890      0  <1e-04 ***
## mix.X1.F.M  -0.98003    0.11338      0  <1e-04 ***
## mix.X1.M.M  -0.47303    0.11663      0  <1e-04 ***
## absdiff.Age -0.96642    0.03418      0  <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance:  9290  on 27490  degrees of freedom
##  
## AIC: 9300    BIC: 9341    (Smaller is better.)

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodemix("X1", base = c(-1, -2, -3)) + nodematch("X0") + 
##     absdiff("Age") + degree(2:5) + degree(8) + degree(12)
## 
## Iterations:  20 out of 20 
## 
## Monte Carlo MLE Results:
##              Estimate Std. Error MCMC % p-value    
## edges        -1.26211    0.06646      0  <1e-04 ***
## mix.X1.F.F    0.14024    0.06037      0  0.0202 *  
## mix.X1.F.M   -0.13757    0.05911      0  0.0199 *  
## mix.X1.M.M    0.47062    0.05744      0  <1e-04 ***
## nodematch.X0  2.97452    0.07566      1  <1e-04 ***
## absdiff.Age   0.29011    0.01011      0  <1e-04 ***
## degree2      14.61122         NA     NA      NA    
## degree3       7.65666         NA     NA      NA    
## degree4       4.82784         NA     NA      NA    
## degree5       3.33014         NA     NA      NA    
## degree8      -1.75119         NA     NA      NA    
## degree12      0.11071         NA     NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance: 28109  on 27483  degrees of freedom
##  
## AIC: 28133    BIC: 28232    (Smaller is better.)

## Sample statistics summary:
## 
## Iterations = 1e+05:5215000
## Thinning interval = 5000 
## Number of chains = 1 
## Sample size per chain = 1024 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##               Mean     SD Naive SE Time-series SE
## edges        10288  74.46   2.3269          6.071
## mix.X1.F.F    2177  35.91   1.1222          3.078
## mix.X1.F.M    3845  46.99   1.4683          3.588
## mix.X1.M.M    2501  36.98   1.1556          3.443
## nodematch.X0  1150  14.56   0.4551          1.771
## absdiff.Age  25710 200.94   6.2795         18.388
## degree2        -10   0.00   0.0000          0.000
## degree3         -8   0.00   0.0000          0.000
## degree4        -10   0.00   0.0000          0.000
## degree5        -14   0.00   0.0000          0.000
## degree8         -8   0.00   0.0000          0.000
## degree12        -9   0.00   0.0000          0.000
## 
## 2. Quantiles for each variable:
## 
##               2.5%   25%   50%   75% 97.5%
## edges        10146 10238 10289 10337 10434
## mix.X1.F.F    2105  2153  2177  2201  2249
## mix.X1.F.M    3752  3814  3844  3879  3938
## mix.X1.M.M    2430  2475  2502  2526  2576
## nodematch.X0  1124  1140  1150  1161  1181
## absdiff.Age  25325 25576 25706 25843 26117
## degree2        -10   -10   -10   -10   -10
## degree3         -8    -8    -8    -8    -8
## degree4        -10   -10   -10   -10   -10
## degree5        -14   -14   -14   -14   -14
## degree8         -8    -8    -8    -8    -8
## degree12        -9    -9    -9    -9    -9
## 
## 
## Sample statistics cross-correlations:
##                  edges mix.X1.F.F  mix.X1.F.M  mix.X1.M.M nodematch.X0
## edges        1.0000000 0.54110445  0.63901830  0.49683419   0.12757846
## mix.X1.F.F   0.5411044 1.00000000  0.04170776  0.06302899   0.08773853
## mix.X1.F.M   0.6390183 0.04170776  1.00000000 -0.02088295   0.04121998
## mix.X1.M.M   0.4968342 0.06302899 -0.02088295  1.00000000   0.12425320
## nodematch.X0 0.1275785 0.08773853  0.04121998  0.12425320   1.00000000
## absdiff.Age  0.7620371 0.36743234  0.36642576  0.35916330  -0.11559052
## degree2             NA         NA          NA          NA           NA
## degree3             NA         NA          NA          NA           NA
## degree4             NA         NA          NA          NA           NA
## degree5             NA         NA          NA          NA           NA
## degree8             NA         NA          NA          NA           NA
## degree12            NA         NA          NA          NA           NA
##              absdiff.Age degree2 degree3 degree4 degree5 degree8 degree12
## edges          0.7620371      NA      NA      NA      NA      NA       NA
## mix.X1.F.F     0.3674323      NA      NA      NA      NA      NA       NA
## mix.X1.F.M     0.3664258      NA      NA      NA      NA      NA       NA
## mix.X1.M.M     0.3591633      NA      NA      NA      NA      NA       NA
## nodematch.X0  -0.1155905      NA      NA      NA      NA      NA       NA
## absdiff.Age    1.0000000      NA      NA      NA      NA      NA       NA
## degree2               NA       1      NA      NA      NA      NA       NA
## degree3               NA      NA       1      NA      NA      NA       NA
## degree4               NA      NA      NA       1      NA      NA       NA
## degree5               NA      NA      NA      NA       1      NA       NA
## degree8               NA      NA      NA      NA      NA       1       NA
## degree12              NA      NA      NA      NA      NA      NA        1
## 
## Sample statistics auto-correlation:
## Chain 1 
##               edges mix.X1.F.F mix.X1.F.M mix.X1.M.M nodematch.X0
## Lag 0     1.0000000  1.0000000  1.0000000  1.0000000    1.0000000
## Lag 5000  0.7435861  0.7651016  0.7128441  0.7973492    0.8759881
## Lag 10000 0.5630193  0.6035315  0.5284366  0.6337419    0.7704237
## Lag 15000 0.4224339  0.4605978  0.3677002  0.4961827    0.6711204
## Lag 20000 0.3164321  0.3457924  0.2691034  0.4018330    0.5953178
## Lag 25000 0.2353476  0.2733610  0.2001352  0.3189354    0.5164186
##           absdiff.Age degree2 degree3 degree4 degree5 degree8 degree12
## Lag 0       1.0000000     NaN     NaN     NaN     NaN     NaN      NaN
## Lag 5000    0.7909311     NaN     NaN     NaN     NaN     NaN      NaN
## Lag 10000   0.6268851     NaN     NaN     NaN     NaN     NaN      NaN
## Lag 15000   0.4979887     NaN     NaN     NaN     NaN     NaN      NaN
## Lag 20000   0.4193958     NaN     NaN     NaN     NaN     NaN      NaN
## Lag 25000   0.3498309     NaN     NaN     NaN     NaN     NaN      NaN
## 
## Sample statistics burn-in diagnostic (Geweke):
## Chain 1 
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
##        edges   mix.X1.F.F   mix.X1.F.M   mix.X1.M.M nodematch.X0 
##       0.8993       0.4526       0.4244      -0.1207      -0.7585 
##  absdiff.Age      degree2      degree3      degree4      degree5 
##       2.2353          NaN          NaN          NaN          NaN 
##      degree8     degree12 
##          NaN          NaN 
## 
## Individual P-values (lower = worse):
##        edges   mix.X1.F.F   mix.X1.F.M   mix.X1.M.M nodematch.X0 
##   0.36847482   0.65086571   0.67130254   0.90392120   0.44814787 
##  absdiff.Age      degree2      degree3      degree4      degree5 
##   0.02540091          NaN          NaN          NaN          NaN 
##      degree8     degree12 
##          NaN          NaN 
## Joint P-value (lower = worse):  0 .

## 
## MCMC diagnostics shown here are from the last round of simulation, prior to computation of final parameter estimates. Because the final estimates are refinements of those used for this simulation run, these diagnostics may understate model performance. To directly assess the performance of the final model on in-model statistics, please use the GOF command: gof(ergmFitObject, GOF=~model).

Model 4

added Nodematch for Grade and Degrees based on GOF and also increased computational power

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodematch("X1", diff = T) + nodematch("X0", 
##     diff = T) + absdiff("Age")
## 
## Iterations:  6 out of 20 
## 
## Monte Carlo MLE Results:
##                       Estimate Std. Error MCMC %  p-value    
## edges                 -5.03047    0.10436      0  < 1e-04 ***
## nodematch.X1.F         0.28886    0.08749      0 0.000963 ***
## nodematch.X1.M         0.74920    0.08435      0  < 1e-04 ***
## nodematch.X1.Unknown   0.30588    0.75447      0 0.685168    
## nodematch.X0.1A        3.87557    0.16913      0  < 1e-04 ***
## nodematch.X0.1B        4.91508    0.14924      0  < 1e-04 ***
## nodematch.X0.2A        5.08792    0.15856      0  < 1e-04 ***
## nodematch.X0.2B        4.18506    0.14944      0  < 1e-04 ***
## nodematch.X0.3A        4.48412    0.15777      0  < 1e-04 ***
## nodematch.X0.3B        5.27094    0.17080      0  < 1e-04 ***
## nodematch.X0.4A        3.78439    0.18224      0  < 1e-04 ***
## nodematch.X0.4B        3.20159    0.21147      0  < 1e-04 ***
## nodematch.X0.5A        4.79063    0.16781      0  < 1e-04 ***
## nodematch.X0.5B        4.09425    0.16255      0  < 1e-04 ***
## nodematch.X0.Teachers  1.16924    1.27047      0 0.357412    
## absdiff.Age            0.16816    0.02633      0  < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance:  6465  on 27479  degrees of freedom
##  
## AIC: 6497    BIC: 6629    (Smaller is better.)

### Model 5 AIC and BIC are still not looking good. P-values are not significant. GOF is not performing well

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodematch("X1", diff = T) + nodematch("X0") + 
##     absdiff("Age")
## 
## Iterations:  7 out of 20 
## 
## Monte Carlo MLE Results:
##                      Estimate Std. Error MCMC % p-value    
## edges                -5.02913    0.10354      0  <1e-04 ***
## nodematch.X1.F        0.33879    0.08444      0  <1e-04 ***
## nodematch.X1.M        0.69893    0.08213      0  <1e-04 ***
## nodematch.X1.Unknown -1.90835    0.60111      0  0.0015 ** 
## nodematch.X0          4.42033    0.10093      0  <1e-04 ***
## absdiff.Age           0.17097    0.02618      0  <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance:  6654  on 27489  degrees of freedom
##  
## AIC: 6666    BIC: 6715    (Smaller is better.)

### Model 6 MCMC statistics have high correlations, and joint p-value is also 0.

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodematch("X1", diff = T) + nodematch("X0") + 
##     absdiff("Age") + degree(1:5)
## 
## Iterations:  20 out of 20 
## 
## Monte Carlo MLE Results:
##                      Estimate Std. Error MCMC % p-value    
## edges                -1.44779    0.02836      0  <1e-04 ***
## nodematch.X1.F        0.32826    0.03589      0  <1e-04 ***
## nodematch.X1.M        0.46388    0.03680      0  <1e-04 ***
## nodematch.X1.Unknown -0.01960    0.24919      1   0.937    
## nodematch.X0          2.87234    0.05881      1  <1e-04 ***
## absdiff.Age           0.20200    0.00702      0  <1e-04 ***
## degree1              15.87292         NA     NA      NA    
## degree2              17.96196         NA     NA      NA    
## degree3              12.06530         NA     NA      NA    
## degree4               9.02377         NA     NA      NA    
## degree5               4.53998         NA     NA      NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 38116  on 27495  degrees of freedom
##  Residual Deviance: 21444  on 27484  degrees of freedom
##  
## AIC: 21466    BIC: 21556    (Smaller is better.)
## Sample statistics summary:
## 
## Iterations = 1e+05:5215000
## Thinning interval = 5000 
## Number of chains = 1 
## Sample size per chain = 1024 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                          Mean      SD Naive SE Time-series SE
## edges                 8671.02  71.864   2.2458          5.967
## nodematch.X1.F        1989.81  34.564   1.0801          2.809
## nodematch.X1.M        2035.56  34.482   1.0776          2.926
## nodematch.X1.Unknown    53.56   4.058   0.1268          0.412
## nodematch.X0          1082.63  18.173   0.5679          2.341
## absdiff.Age          20157.12 224.372   7.0116         21.714
## degree1                 -6.00   0.000   0.0000          0.000
## degree2                -10.00   0.000   0.0000          0.000
## degree3                 -8.00   0.000   0.0000          0.000
## degree4                -10.00   0.000   0.0000          0.000
## degree5                -14.00   0.000   0.0000          0.000
## 
## 2. Quantiles for each variable:
## 
##                       2.5%   25%   50%   75% 97.5%
## edges                 8524  8626  8670  8718  8813
## nodematch.X1.F        1918  1967  1992  2015  2054
## nodematch.X1.M        1965  2014  2037  2060  2097
## nodematch.X1.Unknown    45    51    54    56    61
## nodematch.X0          1050  1070  1082  1095  1120
## absdiff.Age          19718 20011 20151 20310 20589
## degree1                 -6    -6    -6    -6    -6
## degree2                -10   -10   -10   -10   -10
## degree3                 -8    -8    -8    -8    -8
## degree4                -10   -10   -10   -10   -10
## degree5                -14   -14   -14   -14   -14
## 
## 
## Sample statistics cross-correlations:
##                          edges nodematch.X1.F nodematch.X1.M
## edges                1.0000000    0.506013821     0.50352757
## nodematch.X1.F       0.5060138    1.000000000     0.01715936
## nodematch.X1.M       0.5035276    0.017159359     1.00000000
## nodematch.X1.Unknown 0.0521729   -0.002297513     0.03169561
## nodematch.X0         0.2109071    0.073681715     0.16862869
## absdiff.Age          0.7277478    0.337087535     0.23001722
## degree1                     NA             NA             NA
## degree2                     NA             NA             NA
## degree3                     NA             NA             NA
## degree4                     NA             NA             NA
## degree5                     NA             NA             NA
##                      nodematch.X1.Unknown nodematch.X0 absdiff.Age degree1
## edges                         0.052172899   0.21090710  0.72774784      NA
## nodematch.X1.F               -0.002297513   0.07368172  0.33708753      NA
## nodematch.X1.M                0.031695606   0.16862869  0.23001722      NA
## nodematch.X1.Unknown          1.000000000   0.03852014  0.09121932      NA
## nodematch.X0                  0.038520143   1.00000000 -0.01723911      NA
## absdiff.Age                   0.091219319  -0.01723911  1.00000000      NA
## degree1                                NA           NA          NA       1
## degree2                                NA           NA          NA      NA
## degree3                                NA           NA          NA      NA
## degree4                                NA           NA          NA      NA
## degree5                                NA           NA          NA      NA
##                      degree2 degree3 degree4 degree5
## edges                     NA      NA      NA      NA
## nodematch.X1.F            NA      NA      NA      NA
## nodematch.X1.M            NA      NA      NA      NA
## nodematch.X1.Unknown      NA      NA      NA      NA
## nodematch.X0              NA      NA      NA      NA
## absdiff.Age               NA      NA      NA      NA
## degree1                   NA      NA      NA      NA
## degree2                    1      NA      NA      NA
## degree3                   NA       1      NA      NA
## degree4                   NA      NA       1      NA
## degree5                   NA      NA      NA       1
## 
## Sample statistics auto-correlation:
## Chain 1 
##               edges nodematch.X1.F nodematch.X1.M nodematch.X1.Unknown
## Lag 0     1.0000000      1.0000000      1.0000000            1.0000000
## Lag 5000  0.7516683      0.7422407      0.7609935            0.8267206
## Lag 10000 0.5801770      0.5547542      0.5915540            0.6732658
## Lag 15000 0.4603087      0.4180819      0.4811029            0.5453079
## Lag 20000 0.3534212      0.3060658      0.3883866            0.4302482
## Lag 25000 0.2528577      0.2418055      0.3192034            0.3312220
##           nodematch.X0 absdiff.Age degree1 degree2 degree3 degree4 degree5
## Lag 0        1.0000000   1.0000000     NaN     NaN     NaN     NaN     NaN
## Lag 5000     0.8887010   0.8109793     NaN     NaN     NaN     NaN     NaN
## Lag 10000    0.7866424   0.6571145     NaN     NaN     NaN     NaN     NaN
## Lag 15000    0.7021136   0.5371072     NaN     NaN     NaN     NaN     NaN
## Lag 20000    0.6355066   0.4372619     NaN     NaN     NaN     NaN     NaN
## Lag 25000    0.5818446   0.3511194     NaN     NaN     NaN     NaN     NaN
## 
## Sample statistics burn-in diagnostic (Geweke):
## Chain 1 
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
##                edges       nodematch.X1.F       nodematch.X1.M 
##               1.5226               0.3117               2.5783 
## nodematch.X1.Unknown         nodematch.X0          absdiff.Age 
##               1.1857               0.4955               0.9459 
##              degree1              degree2              degree3 
##                  NaN                  NaN                  NaN 
##              degree4              degree5 
##                  NaN                  NaN 
## 
## Individual P-values (lower = worse):
##                edges       nodematch.X1.F       nodematch.X1.M 
##          0.127862755          0.755244733          0.009928507 
## nodematch.X1.Unknown         nodematch.X0          absdiff.Age 
##          0.235735400          0.620244055          0.344178144 
##              degree1              degree2              degree3 
##                  NaN                  NaN                  NaN 
##              degree4              degree5 
##                  NaN                  NaN 
## Joint P-value (lower = worse):  0 .

## 
## MCMC diagnostics shown here are from the last round of simulation, prior to computation of final parameter estimates. Because the final estimates are refinements of those used for this simulation run, these diagnostics may understate model performance. To directly assess the performance of the final model on in-model statistics, please use the GOF command: gof(ergmFitObject, GOF=~model).

### Model 7 Still the model does not perform well with updated degree

## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   ga_2.net ~ edges + nodematch("X1", diff = T) + nodematch("X0") + 
##     absdiff("Age") + degree(1:3) + gwesp(0.25, fixed = T)
## 
## Iterations:  20 out of 20 
## 
## Monte Carlo MLE Results:
##                       Estimate Std. Error MCMC % p-value    
## edges                100.92368    0.76745      0  <1e-04 ***
## nodematch.X1.F       -14.39717    0.47522      2  <1e-04 ***
## nodematch.X1.M        -9.95276    0.28433      4  <1e-04 ***
## nodematch.X1.Unknown  10.45895    5.90279      1  0.0764 .  
## nodematch.X0           0.07386    0.21593      3  0.7323    
## absdiff.Age          -30.10102    0.16209      3  <1e-04 ***
## degree1              293.97616    2.58069      2  <1e-04 ***
## degree2              190.52786    2.44390      2  <1e-04 ***
## degree3               78.92477    7.25561      0  <1e-04 ***
## gwesp.fixed.0.25       1.37738    0.55530      0  0.0131 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance:  38116  on 27495  degrees of freedom
##  Residual Deviance: 749561  on 27485  degrees of freedom
##  
## AIC: 749581    BIC: 749663    (Smaller is better.)
## Sample statistics summary:
## 
## Iterations = 16384:1063936
## Thinning interval = 1024 
## Number of chains = 1 
## Sample size per chain = 1024 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                          Mean       SD  Naive SE Time-series SE
## edges                1592.296 251.9596  7.873739      1.950e+02
## nodematch.X1.F       -279.420  23.3252  0.728912      1.709e+01
## nodematch.X1.M       1660.910   6.0511  0.189096      1.916e+00
## nodematch.X1.Unknown   -2.952   0.2435  0.007609      5.940e-02
## nodematch.X0         -475.146  44.7189  1.397465      3.030e+01
## absdiff.Age          2886.300 342.8155 10.712983      2.699e+02
## degree1                92.493   2.2645  0.070766      1.592e-01
## degree2                47.561   4.2033  0.131354      2.025e+00
## degree3                -4.979   0.1451  0.004533      5.369e-03
## gwesp.fixed.0.25     2018.375 325.7808 10.180649      2.513e+02
## 
## 2. Quantiles for each variable:
## 
##                      2.5%  25%  50%  75%  97.5%
## edges                1223 1406 1561 1797 2095.3
## nodematch.X1.F       -310 -297 -285 -265 -231.0
## nodematch.X1.M       1649 1656 1662 1666 1671.0
## nodematch.X1.Unknown   -3   -3   -3   -3   -2.0
## nodematch.X0         -551 -505 -469 -444 -387.6
## absdiff.Age          2383 2634 2852 3172 3567.4
## degree1                89   91   92   94   97.0
## degree2                40   44   48   51   55.0
## degree3                -5   -5   -5   -5   -5.0
## gwesp.fixed.0.25     1541 1775 1977 2283 2669.9
## 
## 
## Sample statistics cross-correlations:
##                            edges nodematch.X1.F nodematch.X1.M
## edges                 1.00000000     0.99132684    -0.12526221
## nodematch.X1.F        0.99132684     1.00000000    -0.12641307
## nodematch.X1.M       -0.12526221    -0.12641307     1.00000000
## nodematch.X1.Unknown  0.39885819     0.42486353     0.23910165
## nodematch.X0          0.98567530     0.96829408    -0.17575053
## absdiff.Age           0.99919003     0.98935111    -0.10005555
## degree1              -0.10033683    -0.09397505     0.01400860
## degree2              -0.83621179    -0.83215863     0.12988549
## degree3               0.02143553     0.03358081    -0.02118473
## gwesp.fixed.0.25      0.99998252     0.99131560    -0.12570837
##                      nodematch.X1.Unknown nodematch.X0 absdiff.Age
## edges                          0.39885819   0.98567530  0.99919003
## nodematch.X1.F                 0.42486353   0.96829408  0.98935111
## nodematch.X1.M                 0.23910165  -0.17575053 -0.10005555
## nodematch.X1.Unknown           1.00000000   0.40156260  0.39339896
## nodematch.X0                   0.40156260   1.00000000  0.98143866
## absdiff.Age                    0.39339896   0.98143866  1.00000000
## degree1                       -0.05702137  -0.09497544 -0.09039615
## degree2                       -0.29938302  -0.83003889 -0.83923287
## degree3                       -0.02913327   0.01103371  0.02204290
## gwesp.fixed.0.25               0.39884983   0.98571721  0.99913458
##                          degree1     degree2     degree3 gwesp.fixed.0.25
## edges                -0.10033683 -0.83621179  0.02143553        0.9999825
## nodematch.X1.F       -0.09397505 -0.83215863  0.03358081        0.9913156
## nodematch.X1.M        0.01400860  0.12988549 -0.02118473       -0.1257084
## nodematch.X1.Unknown -0.05702137 -0.29938302 -0.02913327        0.3988498
## nodematch.X0         -0.09497544 -0.83003889  0.01103371        0.9857172
## absdiff.Age          -0.09039615 -0.83923287  0.02204290        0.9991346
## degree1               1.00000000 -0.44879370  0.04805910       -0.1022904
## degree2              -0.44879370  1.00000000 -0.07427729       -0.8351722
## degree3               0.04805910 -0.07427729  1.00000000        0.0215547
## gwesp.fixed.0.25     -0.10229039 -0.83517222  0.02155470        1.0000000
## 
## Sample statistics auto-correlation:
## Chain 1 
##              edges nodematch.X1.F nodematch.X1.M nodematch.X1.Unknown
## Lag 0    1.0000000      1.0000000      1.0000000            1.0000000
## Lag 1024 0.9967397      0.9963635      0.9806860            0.9520802
## Lag 2048 0.9934831      0.9927468      0.9608453            0.9041605
## Lag 3072 0.9902240      0.9891875      0.9416382            0.8562407
## Lag 4096 0.9869741      0.9856516      0.9214165            0.8083209
## Lag 5120 0.9836984      0.9820377      0.9025006            0.7604012
##          nodematch.X0 absdiff.Age   degree1   degree2     degree3
## Lag 0       1.0000000   1.0000000 1.0000000 1.0000000  1.00000000
## Lag 1024    0.9957502   0.9968509 0.6612215 0.8981141  0.25673777
## Lag 2048    0.9915909   0.9936874 0.4575008 0.8353756 -0.02199897
## Lag 3072    0.9874383   0.9904848 0.3161060 0.7912070 -0.02202041
## Lag 4096    0.9832946   0.9872869 0.1794769 0.7482556 -0.02204185
## Lag 5120    0.9790890   0.9840394 0.1266253 0.7300598  0.02438925
##          gwesp.fixed.0.25
## Lag 0           1.0000000
## Lag 1024        0.9967200
## Lag 2048        0.9934507
## Lag 3072        0.9901912
## Lag 4096        0.9869426
## Lag 5120        0.9836766
## 
## Sample statistics burn-in diagnostic (Geweke):
## Chain 1 
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
##                edges       nodematch.X1.F       nodematch.X1.M 
##              -4.2059              -3.7005               1.2851 
## nodematch.X1.Unknown         nodematch.X0          absdiff.Age 
##              -0.8431              -6.4607              -3.9156 
##              degree1              degree2              degree3 
##               2.1624               8.9570              -0.4088 
##     gwesp.fixed.0.25 
##              -4.2399 
## 
## Individual P-values (lower = worse):
##                edges       nodematch.X1.F       nodematch.X1.M 
##         2.600980e-05         2.152092e-04         1.987610e-01 
## nodematch.X1.Unknown         nodematch.X0          absdiff.Age 
##         3.991559e-01         1.042219e-10         9.019679e-05 
##              degree1              degree2              degree3 
##         3.058421e-02         3.336467e-19         6.826770e-01 
##     gwesp.fixed.0.25 
##         2.236109e-05 
## Joint P-value (lower = worse):  0 .

## 
## MCMC diagnostics shown here are from the last round of simulation, prior to computation of final parameter estimates. Because the final estimates are refinements of those used for this simulation run, these diagnostics may understate model performance. To directly assess the performance of the final model on in-model statistics, please use the GOF command: gof(ergmFitObject, GOF=~model).

CUG test

High Assortativity on both Grade and Gender attributes. The Grade has higher assortativity so the assortativity is higher than random generated graphs.

## [1] 0.8271385
## [1] 0.9335869

## 
## Univariate Conditional Uniform Graph Test
## 
## Conditioning Method: edges 
## Graph Type: 
## Diagonal Used: FALSE 
## Replications: 1000 
## 
## Observed Value: 0.8271385 
## Pr(X>=Obs): 0 
## Pr(X<=Obs): 1

## 
## Univariate Conditional Uniform Graph Test
## 
## Conditioning Method: edges 
## Graph Type: 
## Diagonal Used: FALSE 
## Replications: 1000 
## 
## Observed Value: 0.9335869 
## Pr(X>=Obs): 0 
## Pr(X<=Obs): 1

QAP test

Assortativity test passes for QAP test also. High Assotativity for Grade than Gender. The nodes were not randomly assortative.

## 
## QAP Test Results
## 
## Estimated p-values:
##  p(f(perm) >= f(d)): 0 
##  p(f(perm) <= f(d)): 1 
## 
## Test Diagnostics:
##  Test Value (f(d)): 0.8271385 
##  Replications: 1000 
##  Distribution Summary:
##      Min:     -0.1089685 
##      1stQ:    -0.02563496 
##      Med:     -0.006615038 
##      Mean:    -0.005426089 
##      3rdQ:    0.01289734 
##      Max:     0.1062484

## 
## QAP Test Results
## 
## Estimated p-values:
##  p(f(perm) >= f(d)): 0 
##  p(f(perm) <= f(d)): 1 
## 
## Test Diagnostics:
##  Test Value (f(d)): 0.9335869 
##  Replications: 1000 
##  Distribution Summary:
##      Min:     -0.08849596 
##      1stQ:    -0.02509786 
##      Med:     -0.004233134 
##      Mean:    -0.004648804 
##      3rdQ:    0.01395662 
##      Max:     0.1220312

Conditional Probability For Grade Match, Male-Male, Female-Female, Male-Female Edges forming

Highest probability for Same grade nodes to form an edge

##          Case edges nodemixFF nodemixFM nodemixMM nodematch.XO    logodds
## 1         F-M     1         0         1         0            0 -4.7341445
## 2         F-F     1         1         0         0            0 -4.1174639
## 3         M-M     1         0         0         1            0 -3.9536443
## 4 Grade-Match     1         0         0         0            1  0.2547093
##     cond_prob
## 1 0.008713375
## 2 0.016024789
## 3 0.018823536
## 4 0.563335289